from homeworks.HeJian.link import list
l = list()

class ListNode:
    def reverselist(self, phead):
        if not phead or not phead.next:
            return phead
        newhead = self.reverselist(phead.next)
        phead.next.next = phead
        phead.next = None
        return newhead


